#ifndef CAMERAWIDGET_H
#define CAMERAWIDGET_H

#include <QWidget>
#include <QBoxLayout>
#include <QVBoxLayout>
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include "qopencvwidget.h"
#include "robotwidget.h"
#include "camera.h"

class CameraWidget : public QWidget
{
    Q_OBJECT
private:
    QOpenCVWidget *cvwidget;
    QBoxLayout *robotLayout;
    Camera *camera;
public:
    CameraWidget(Camera *camera, QBoxLayout *robotLayout, QWidget *parent=0);
private:
    double grad2rad(double grad);
    CvPoint robotEndPointRad(CvPoint center, double radian, int robotRadius);
    CvPoint robotEndPointGrad(CvPoint center, double grad, int robotRadius);
    IplImage* printObject(IplImage* image, int x, int y, double radian, CvScalar color, int robotRadius, int lineWidth, int trans);
private slots:
    void reprint();
};

#endif // CAMERAWIDGET_H
